import {instance, addChannelParams, addChannelSearchParams} from './instance';
import {ResponseData} from "@/types/utils";
import {IndexBanner, PageRes} from "@/types/public";

// 获取首页轮播
export function fetchBanners() {
    return instance.get(addChannelSearchParams('Slideshow/finds')).json<ResponseData<PageRes & {
        data: IndexBanner[]
    }>>();
}

// 获取自定义列
export function fetchCols<D>(data: D) {
    return instance.post('SecondAccount/reportField', {json: addChannelParams(data)}).json<ResponseData<any>>();
}

// 首页数据面板
export function fetchIndexDataPanel<D>(data: D) {
    return instance.post('SecondAccount/getAdvertiserReportTotal', {json: addChannelParams(data)}).json<ResponseData<any>>();
}

